import { StructureCluster } from "./cluster";
import { StructureCore } from "./core";

export class StructureFlow extends StructureCluster{
    constructor(spawnRoom = undefined){
        super(spawnRoom);
        if(spawnRoom !== undefined){
            this.core = new StructureCore(spawnRoom);
            this.structureGroups.push(this.core);
        }
    }

    serialize(){
        return {
            super: super.serialize(),
            core: this.core.serialize(),
        }
    }
    deserialize(obj){
        super.deserialize(obj.super);
        this.core = new StructureCore().deserialize(obj.core);

        this.structureGroups.push(this.core);
        return this;
    }
}